package com.liuhan.house.controller;

import com.liuhan.house.pojo.House;
import com.liuhan.house.service.HouseService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.List;


@Controller
public class IndexController {
    @Autowired
    private HouseService houseService;

    /**
     * 跳转到登录页面
     * @return
     */
    @RequestMapping("homepage/index")
    public String pageIndex(ModelMap modelMap) {
        List<House> houseList = houseService.getNewHouse();
        modelMap.put("newHouse", houseList);
        return "/homepage/index";
    }
}
